<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *订单管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$tabs=array(
	array('op'=>'list','title'=>'全部记录'),
); 
if($_RQ['op']=='list'){
	$return['params']=array();
	$params=array('uniacid'=>$_SESSION['uniacid']);
	if($_RQ['type']){
		$params['type']=intval($_RQ['type']);
		$return['params']['type']=intval($_RQ['type']);
	}
	if($_RQ['status']){
		$params['status']=intval($_RQ['status']);
		$return['params']['status']=intval($_RQ['status']);
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$list=pdo_getslice('jy_023sm_log',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	if($list){
		foreach($list as $k=>&$item){
			$item['plugintitle']=pdo_getcolumn('core_plugins',array('name'=>$item['pluginname']),'title');
			$item['content']=json_decode($item['content'],true);
			if($item['type']==1){
				$item['infodesc']='主体法人备案上报';
			}elseif($item['type']==2){
				$item['infodesc']='自然人备案上报';
			}elseif($item['type']==3){
				$item['infodesc']='查询了'.$item['content']['goodstitle'].'-商品';
			}else{
				$item['infodesc']=$item['content']['goodstitle'].'-商品上报';
			}
			
		}
	}
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>$tabs,
		'list'=>array('data'=>'list','edit'=>false,'del_one'=>false,'delall'=>false,'list'=>array(
			array('name'=>'plugintitle','title'=>'所属插件','type'=>'string'),
			array('name'=>'infodesc','title'=>'内容简要','type'=>'string'),
			array('name'=>'type','title'=>'类型','type'=>'radio','options'=>'types'),
			array('name'=>'status','title'=>'状态','type'=>'radio','options'=>'statuss'),
			array('name'=>'createtime','title'=>'时间','type'=>'time'),
		)),
		'search'=>array(
			array('name'=>'type','width'=>15,'title'=>'类型','type'=>'radio','options'=>'types'),
			array('name'=>'status','width'=>15,'title'=>'状态','type'=>'radio','options'=>'statuss'),
		),
	);
	$return['statuss']=$this->statuss;
	$return['types']=$this->types;
	$return['htmls']=$htmls;	
	exi($return);
}
